<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section A.4.&nbsp; Chapter 4</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
<script type="text/javascript"><!--
google_ad_client = "pub-0203281046321155";
google_alternate_ad_url = "http://www.bookhtml.com/adbrite.htm";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="4867465545";
google_color_border = "FFFFFF";
google_color_link = "0000FF";
google_color_bg = "FFFFFF";
google_color_text = "000000";
google_color_url = "0000FF";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-3.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-5.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><TD valign="top"><a name="learnphpmysql-APP-A-SECT-4"></a>
<h3 id="title-IDADUBXG" class="docSection1Title">A.4. Chapter 4</h3>
<dl class="docList">
<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-1</span></span></p></dt>
<dd><p class="docList">Code that performs a task.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-2</span></span></p></dt>
<dd><p class="docList">An operator.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-3</span></span></P></dt>
<dd><p class="docList">An operator combines simple expressions into more complex expressions. It does so by creating relationships between the simple expressions that can then be evaluated.</p></dd>

<dt><br><P><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-4</span></span></P></dt>
<dd><p class="docList">An operator.</p></dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-5</span></span></p></dt>
<dd><p class="docList">An operator that combines two expressions into a more complex single expression.</p></dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-6</span></span></P></dt>
<dd><p class="docList">An operator that takes three operands.</p></dd>

<dt><br><P><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-7</span></span></P></dt>
<dd><p class="docList">Nothey take only numbers.</p></dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-8</span></span></p></dt>
<dd><p class="docList">It's an array, integer, or string.</P></dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-9</span></span></p></dt>
<dd><p class="docList">Yesyou'll end up with the wrong operator.</p></dd>

<dt><br><P><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-10</span></span></p></dt>
<dd><p class="docList">It checks whether or not a variable is set.</P></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-11</span></span></P></dt>
<dd><p class="docList">The switch statement is written as follows:</P>
<pre>
switch ($action) {
  case "add":
    $x = $x+y;
    break;
  case "subtract":
    $x = $x-y;
    break;
  case "multiply":
    $x = $x*$y;
    break;
  case "divide":
    $x = $x/$y;
    break;
}
</pre><br>

</dd>

<dt><BR><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-12</span></span></p></dt>
<dd><p class="docList">It tells PHP not to execute cases other than the matching case.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 4-13</span></span></p></dt>
<dd><p class="docList">The loop is written as follows:</p>
<pre>
&lt;?php
for ($num = 10; $num &gt;= 1; $num--) {
    print "$num&lt;br&gt;";
}
?&gt;
</pre><br>

</dd>
</dl>

</TD></TR></table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-3.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-5.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html>
